﻿using System;
using System.Xml;
using System.Xml.Serialization;
using System.Collections.Generic;
using System.Linq;
using System.Text;

using EAI.Config;

namespace EAI.ServiceHost
{
    [Serializable]
    public class EAIServiceConfig : ConfigBase
    {
        public static readonly string EAIServiceConfigPath = @"Config\EAIServiceConfig.xml";

        public EAIServiceConfig()
            : base()
        {
            base.ConfigPath = EAIServiceConfigPath;
        }

        [XmlArray("categories")]
        [XmlArrayItem("category")]
        public List<EAIServiceCategory> Categories { get; set; }      
    }

    [Serializable]
    public class EAIServiceCategory
    {
        [XmlAttribute("categroy")]
        public string Categroy { get; set; }

        [XmlAttribute("baseAddress")]
        public string BaseAddress { get; set; }   

        [XmlArray("services")]
        [XmlArrayItem("service")]
        public List<EAIServiceItem> Services { get; set; }
    }

    [Serializable]
    public class EAIServiceItem
    {
        [XmlAttribute("name")]
        public string Name { get; set; }

        [XmlAttribute("binding")]
        public string Binding { get; set; }

        [XmlAttribute("service")]
        public string Service { get; set; }

        [XmlAttribute("contract")]
        public string Contract { get; set; }
    }
}
